package ipcards.gui;
import ipcards.Card;
import ipcards.CardSet;

import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;


public class DebugOutput extends JFrame {
	
	private JPanel panel = new JPanel();
	private JTextArea text = new JTextArea();
	
	public DebugOutput(String title) {
		super(title);
		this.setPreferredSize(new Dimension(150, 400));
		this.add(panel);
		panel.add(text);
		this.pack();
		this.setVisible(true);	
	}
	
	public void update(CardSet set) {
		text.setText("");
		for(Card c: set) {
			text.setText(text.getText() +c.getID() + ": "+ c.getLocation().x + ", " + c.getLocation().y + "\r\n");
		}
	}
}
